Skip to content

fix(pm-stack): drop unsafe-integer registry refs at projectorLinks and the POST /links gate (#6211) - #6244

Merged
developing-today[bot] merged 1 commit into
mainfrom
queue/10561-6211-unsafe-integer-registry-refs
Nov 5, 2026
Merged

developing-today[bot] merged 1 commit into
mainfrom
queue/10561-6211-unsafe-integer-registry-refs

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #6211 (queue task 10561).

What

Both layers from the issue's acceptance criteria, so a registry link whose ref parseRef rejects can neither be stored nor reach a renderer:

  1. Aggregator read boundary — projectorLinks (pm-stack/aggregator/src/sources/live.ts) now filters rows through the shared isValidRef rule (pm-stack(aggregator): validateNewComment/validateNewAction accept ref keys parseRef rejects (GH_REF number unbounded) #4952). Stored legacy/seeded rows bypass the POST gate entirely, so the drop happens here, with a [registry] WARNING log line naming the dropped ref and subject (provenance-visible, not silent).
  2. Projector write gate — POST /links (pm-stack/projector/src/server.ts) now validates with the new isStorableLinkRef: the existing owner/repo#N shape check plus Number.isSafeInteger on the number — the same semantics as parseRef, closing the /^[\w.-]+\/[\w.-]+#\d+$/ shape-regex gap the issue documents (model.ts:463-466 anti-pattern).

Effect: /search and project-page roadmap rendering survive a board item / roadmap row whose registry rows contain an unsafe-integer ref or a non-GitHub-shaped ref — the bad link is omitted at ingest, sibling good links still render as links. Valid refs are unchanged.

Oracle

Regression tests name their oracle explicitly: the shared isValidRef/parseRef rule from #4952 is the decision procedure for which refs are usable, applied at both boundaries.

  • pm-stack/aggregator/test/registry-ref-filter-6211.test.ts — board subject drops an unsafe-integer ref, roadmap subject drops a non-GitHub-shaped ref and an unsafe ref, good refs kept; /search renders both enriched entries with the good ref and neither bad ref.
  • pm-stack/projector/test/links-ref-gate-6211.test.ts — isStorableLinkRef unit cases (incl. 9007199254740991 accepted / 9007199254740992 rejected) and POST /links end-to-end: unsafe-integer ref → 400 with nothing stored; boundary and ordinary refs → 201.

Verification (laptop, branch base ffdd4f5)


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 5, 2026 14:23
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9227b8dc-6140-4293-a93a-b447a21bdb67

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

0 participants